const { BaseBehavior, COMPONENT_OPTIONS } = require('../../mixins/component');
const { FEATURE_NAV } = require('../../constants/route');
const { navTo } = require('../../common/platform');

Component({
    behaviors: [BaseBehavior],
    options: {
        ...COMPONENT_OPTIONS,
    },
    properties: {
        menuInfo: {
            type: Object,
            value: {},
        },
    },
    methods: {
        menuTapAction() {
            // 跳转到相应的地址
            const { navType, goodsIds, name } = this.data.menuInfo;
            navTo(FEATURE_NAV[navType], {
                goodsIds: (goodsIds || []).join(','),
                title: name,
            })
        },
    }
})
